package com.cityeye.util;

import java.math.BigDecimal;
import java.text.DecimalFormat;

public abstract class IEntity implements Cloneable{
//	public MathContext mc=new MathContext(2,RoundingMode.HALF_UP);
	public static DecimalFormat floatFormater = new DecimalFormat("###0.00");
	
	public abstract Integer getId();

	public abstract String getName(); 
	
	public String toString(){
		return getName();
	}
	
	protected boolean boolValue(Short value){
		if(value!=null && value!=0)
			return true;
		else
			return false;
	}
	
	protected Short shortValue(boolean value){
		return (short)(value?1:0);		
	}
	
	public static BigDecimal trimPrecision(BigDecimal num) {
		return (num.divide(new BigDecimal(1.0), 2,BigDecimal.ROUND_HALF_UP));
	}

	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
	
}
